<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>同港网约车</title>
    <meta name="renderer" content="webkit">
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <meta name="msapplication-tap-highlight" content="no">
    <link rel="stylesheet" href="css/style.css?2019_08_14">
    <link rel="stylesheet" href="css/xxdt.css?2019_9_4">
</head>
<body>
<div class="top">
    <a href="javascript:void(0)">
        <img src="img/zuofan.png" alt=""> 信息大厅
    </a>
</div>
<div class="cont" id="wrapper">
    <div id="scroller">
        <ul>
<!--            <li>-->
<!--                        <p><span>09:30</span></p>-->
<!--                        <div>-->
<!--                            <div class="cont_top">-->
<!--                                <div class="cont_top_l">-->
<!--                                    <img src="img/fdsf.jpg" alt="">-->
<!--                                </div>-->
<!--                                <div class="cont_top_z">-->
<!--                                    <p><span>周师傅</span>正在寻找乘客</p>-->
<!--                                    <div>别克英朗，白色</div>-->
<!--                                </div>-->
<!--                                <div class="cont_top_r">-->
<!--                                    <a href="tel:110"><img src="img/dianhud.png" alt=""></a>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                            <div class="cont_ul">-->
<!--                                <p><i></i><span>今天 15:00</span></p>-->
<!--                                <div class="cont_ul_li_cf">-->
<!--                                    <i></i><span>融科·橡树澜湾(西南门)</span>-->
<!--                                </div>-->
<!--                                <div class="cont_ul_li_md">-->
<!--                                    <i></i><span>重庆市江北机场</span>-->
<!--                                </div>-->
<!--                                <div class="dwk_ul_ms">-->
<!--                                    <div class="dwk_ul_ms_yc"><span class="wk_ul_ms_ckgd">查看更多</span>描述:重描述:重描述:重庆到彭水接接包庆到彭水接接包庆到彭水接接包<span class="wk_ul_ms_sq" style="display:none;">收起</span></div>-->
<!--                                </div>-->

<!--                            </div>-->
<!--                            <div class="cont_bottom">-->
<!--                                <div class="cont_bottom_l">-->
<!--                                    <span>车费：</span><div>￥<span>80</span>.00</div>-->
<!--                                </div>-->
<!--                                <div class="cont_bottom_r">请他接我</div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                    </li>-->
<!--            <li>-->
<!--                <p><span>09:30</span></p>-->
<!--                <div>-->
<!--                    <div class="cont_top">-->
<!--                        <div class="cont_top_l">-->
<!--                            <img src="img/fdsf.jpg" alt="">-->
<!--                        </div>-->
<!--                        <div class="cont_top_z">-->
<!--                            <p><span>周师傅</span>正在寻找乘客</p>-->
<!--                            <div>别克英朗，白色</div>-->
<!--                        </div>-->
<!--                        <div class="cont_top_r">-->
<!--                            <a href="tel:110"><img src="img/dianhud.png" alt=""></a>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                    <div class="cont_ul">-->
<!--                        <p><i></i><span>今天 15:00</span></p>-->
<!--                        <div class="cont_ul_li_cf">-->
<!--                            <i></i><span>融科·橡树澜湾(西南门)</span>-->
<!--                        </div>-->
<!--                        <div class="cont_ul_li_md">-->
<!--                            <i></i><span>重庆市江北机场</span>-->
<!--                        </div>-->
<!--                        <div class="dwk_ul_ms">-->
<!--                            <div class="dwk_ul_ms_yc"><span class="wk_ul_ms_ckgd">查看更多</span>描述:重描述:重描述:重庆到彭水接接包庆到彭水接接包庆到彭水接接包<span class="wk_ul_ms_sq" style="display:none;">收起</span></div>-->
<!--                        </div>-->

<!--                    </div>-->
<!--                    <div class="cont_bottom">-->
<!--                        <div class="cont_bottom_l">-->
<!--                            <span>车费：</span><div>￥<span>80</span>.00</div>-->
<!--                        </div>-->
<!--                        <div class="cont_bottom_r">请他接我</div>-->
<!--                    </div>-->
<!--                </div>-->

<!--            </li>-->
<!--            <li>-->
<!--                <p><span>09:30</span></p>-->
<!--                <div>-->
<!--                    <div class="cont_top">-->
<!--                        <div class="cont_top_l">-->
<!--                            <img src="img/fdsf.jpg" alt="">-->
<!--                        </div>-->
<!--                        <div class="cont_top_z">-->
<!--                            <p><span>周师傅</span>正在寻找乘客</p>-->
<!--                            <div>别克英朗，白色</div>-->
<!--                        </div>-->
<!--                        <div class="cont_top_r">-->
<!--                            <a href="tel:110"><img src="img/dianhud.png" alt=""></a>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                    <div class="cont_ul">-->
<!--                        <p><i></i><span>今天 15:00</span></p>-->
<!--                        <div class="cont_ul_li_cf">-->
<!--                            <i></i><span>融科·橡树澜湾(西南门)</span>-->
<!--                        </div>-->
<!--                        <div class="cont_ul_li_md">-->
<!--                            <i></i><span>重庆市江北机场</span>-->
<!--                        </div>-->
<!--                        <div class="dwk_ul_ms">-->
<!--                            <div class="dwk_ul_ms_yc"><span class="wk_ul_ms_ckgd">查看更多</span>描述:重描述:重描述:重庆到彭水接接包庆到彭水接接包庆到彭水接接包<span class="wk_ul_ms_sq" style="display:none;">收起</span></div>-->
<!--                        </div>-->

<!--                    </div>-->
<!--                    <div class="cont_bottom">-->
<!--                        <div class="cont_bottom_l">-->
<!--                            <span>车费：</span><div>￥<span>80</span>.00</div>-->
<!--                        </div>-->
<!--                        <div class="cont_bottom_r">请他接我</div>-->
<!--                    </div>-->
<!--                </div>-->

<!--            </li>-->

        </ul>
        <div class="pull_loading" style="display: none">
            <i class="pull_loading_img" style="display: none"><img src="img/xiangg.png" alt=""></i>
            <i class="pull_loading_img1" style="display: none"><img src="img/loading.png" alt=""></i>
            <span>上拉加载</span>
        </div>
    </div>

</div>
<!--选择人数弹出框-->
<div class="xzrstc" style="display:none;">
    <div class="contxiao">
        <div>
            <div class="contxiao_con">
                <div class="contxiao_con_title">选择你的拼车人数</div>
                <div  class="contxiao_con_tisi">(若有婴儿同行，需计入乘车人数)</div>
                <div class="contxiao_con_ul">
                    <ul>
                        <li class="contxiao_con_ul_hov">1</li>
                        <li>2</li>
                        <li>3</li>
                        <li>4</li>
                        <li>5</li>
                        <li>6</li>
                    </ul>
                </div>
                <div class="jieshoupc">
                    <div class="jieshoupc_l">
                        <p>接受拼车</p>
                        <div>6人乘车不可拼车</div>
                    </div>
                    <div class="jieshoupc_r">
                        <i class="jieshoupc_r_i"></i>
                    </div>
                </div>
                <div class="contxiao_con_cf">
                    车费：<span>￥<b>60</b>.00</span>
                </div>
                <div class="contxiao_con_beiz">
                    <span>备注</span><input type="text" placeholder="如：大件物品">
                </div>
            </div>
            <div class="hujiao">请他接我</div>
        </div>
    </div>
</div>
<!--    用于判断查看更多显示隐藏-->
<div class="dlk_fz">
    <p id="dsadw"><span></span></p>
    <div>描述：查看更多</div>
</div>

</body>
<script type="text/javascript" charset="utf-8" src="js/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/style.js?2019_08_14"></script>
<script type="text/javascript" charset="utf-8"  src="js/iscroll.js"></script>
<script>
    let token=GJ.get_cache("token");  //用户id
    let orderid=GJ.getUrlString("orderid");  //订单id
    // 分页变量
    let fenyindex='';
    let count=10;           //每页条数
    let fenypage=1;
    let contlist='';   // 页面内容
    let windowheig=document.documentElement.clientHeight;
    $("#wrapper").css({'height':windowheig});
    // 查看更多
    $(document).on("click",'.wk_ul_ms_ckgd',function(){
        $(this).parent().removeClass("dwk_ul_ms_yc");
        $(this).hide();
        $(this).siblings("span").show()
    });
    // 收起
    $(document).on("click",'.wk_ul_ms_sq',function () {
        $(this).hide();
        $(this).siblings("span").show();
        $(this).parent().addClass("dwk_ul_ms_yc");
    });
    // 用于查看更多显示隐藏
    function webkd(data) {
        // console.log(data);
        $("#dsadw").html(`<span>描述:${data}查看更多</span>`);
        let height=$("#dsadw>span").height().toFixed(0);
        let width=$("#dsadw>span").width().toFixed(0);
        let zongwid=$(".dlk_fz>div").width().toFixed(0);
        let zonghei=$(".dlk_fz>div").height().toFixed(0);
        let zhonghe=Number(zonghei)+Number(zongwid);
        let kasi=Number(height)+Number(width);
        return kasi>zhonghe
    }
    webkd("");
    chushihua();

    function chushihua() {
        $.ajax({
            url: appPara.mwurl + "app/netcarorder/getLiftDriver",
            type: 'POST',
            dataType: 'json',
            data: {
                token:token,
                orderid:orderid,
                page:1,
                count:count
            },
            success: function (data) {
                GJ.loadHide();
                console.log(data);

                if(data.code==0){
                    fenyindex=data.data.length;
                    GJ.loadHide();
                    data.data.forEach(item=>{
                        contlist+=
                        `<li>
                            <p><span>${item.orderuptime}</span></p>
                            <div>
                                <div class="cont_top">
                                    <div class="cont_top_l">
                                        <img src="${item.avatar}" alt="">
                                    </div>
                                    <div class="cont_top_z">
                                        <p><span>${item.username}</span>正在寻找乘客</p>
                                        <div>${item.brand},${item.platecolor}</div>
                                    </div>
                                    <div class="cont_top_r">
                                        <a href="tel:${item.phone}"><img src="img/dianhud.png" alt=""></a>
                                    </div>
                                </div>
                                <div class="cont_ul">
                                    <p><i></i><span>${item.ordertime}</span></p>
                                    <div class="cont_ul_li_cf">
                                        <i></i><span>${item.orderupaddress}</span>
                                    </div>
                                    <div class="cont_ul_li_md">
                                        <i></i><span>${item.orderdownaddress}</span>
                                    </div>
                                    <div class="dwk_ul_ms" style="display: ${item.memo==null||item.memo==""?"none":'block'}">
                                        <div class="dwk_ul_ms_yc"><span class="wk_ul_ms_ckgd" style="display: ${webkd(item.memo)?"block":"none"}">查看更多</span>描述:${item.memo}<span class="wk_ul_ms_sq" style="display:none;">收起</span></div>
                                    </div>

                                </div>
                                <div class="cont_bottom">
                                    <div class="cont_bottom_l">
                                        <span>车费：</span><div>￥<span>${(item.price).substr(0,(item.price).indexOf("."))}</span>${item.price.substr(item.price.indexOf("."))}</div>
                                    </div>
                                    <div class="cont_bottom_r" data-id="${item.orderid}">请他接我</div>
                                </div>
                            </div>
                        </li>`
                    });
                    myscroll.refresh();
                   $(".cont ul").html(contlist)
                }else if(data.code==101){
                    let dqurl=window.location.href;
                    window.location.href=`${appPara.mwurl}/app/webchatCall?url=${dqurl}`
                }else{
                    GJ.msg(data.msg,2000);
                    GJ.loadHide()
                }
            },
            timeout: 20000,
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                GJ.loadHide();
                GJ.msg("网络太忙了，请稍后再试！",2000);
            }
        });
    }
    // 点击请司机接我
    $(document).on("click",'.cont_bottom_r',function () {
        let driverOrderId=$(this).attr("data-id");
        $.ajax({
            url: appPara.mwurl + "app/netcarorder/liftApplyDriver",
            type: 'POST',
            dataType: 'json',
            data: {
                token:token,
                orderid:orderid,
                driverOrderId:driverOrderId
            },
            success: function (data) {
                GJ.loadHide();
                console.log(data);
                if(data.code==0){
                    GJ.loadHide();
                    window.location.href=`ddyd.html?orderid=${orderid}`
                }else if(data.code==101){
                    let dqurl=window.location.href;
                    window.location.href=`${appPara.mwurl}/app/webchatCall?url=${dqurl}`
                }else{
                    GJ.msg(data.msg,2000);
                    GJ.loadHide()
                }
            },
            timeout: 20000,
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                GJ.loadHide();
                GJ.msg("网络太忙了，请稍后再试！",2000);
            }
        });
    });
    // t头部返回
    $(".top a").click(function () {
        window.location.href=`ddyd.html?orderid=${orderid}`
    });
    // 初始化上拉加载
    var myscroll = new iScroll("wrapper", {
        onScrollMove: function () { //拉动时
            //上拉加载
            if (this.y < this.maxScrollY) {
                $(".pull_loading span").text("释放加载");
                $(".pull_loading").addClass("loading");
                $(".pull_loading_img").show().addClass("pull_loading_img_xz");
                $(".pull_loading_img1").hide();
            } else {
                $(".pull_loading span").text("上拉加载");
                $(".pull_loading").removeClass("loading");
                $(".pull_loading_img").show().removeClass("pull_loading_img_xz");
                $(".pull_loading_img1").hide();
            }
        },
        onScrollEnd: function () { //拉动结束时
            //上拉加载
            if ($(".pull_loading").hasClass('loading')) {
                $(".pull_loading span").text("加载中...");
                $(".pull_loading_img1").show();
                $(".pull_loading_img").hide().removeClass("pull_loading_img_xz");
                fenye();
            }
        },
        onRefresh: function () {
           let nr_height=$("#scroller").height()+$(".dyk_top").height()+$(".daoh").height();
            if(nr_height<windowheig){
                $('.pull_loading').hide();
            }else{
                $('.pull_loading').show();
            }
        }
    });

    // 分页
    function fenye() {
        console.log("分页");
        if(fenyindex==count){
            fenypage++;
            $.ajax({
                url: appPara.mwurl + "app/netcarorder/getLiftDriver",
                type: 'POST',
                dataType: 'json',
                data: {
                    token:token,
                    orderid:orderid,
                    page:fenypage,
                    count:count
                },
                success: function (data) {
                    GJ.loadHide();
                    console.log(data);

                    if(data.code==0){
                        fenyindex=data.data.length;
                        GJ.loadHide();
                        data.data.forEach(item=>{
                            contlist+=
                                `<li>
                            <p><span>${item.orderuptime}</span></p>
                            <div>
                                <div class="cont_top">
                                    <div class="cont_top_l">
                                        <img src="${item.avatar}" alt="">
                                    </div>
                                    <div class="cont_top_z">
                                        <p><span>${item.username}</span>正在寻找乘客</p>
                                        <div>${item.brand},${item.platecolor}</div>
                                    </div>
                                    <div class="cont_top_r">
                                        <a href="tel:${item.phone}"><img src="img/dianhud.png" alt=""></a>
                                    </div>
                                </div>
                                <div class="cont_ul">
                                    <p><i></i><span>${item.ordertime}</span></p>
                                    <div class="cont_ul_li_cf">
                                        <i></i><span>${item.orderupaddress}</span>
                                    </div>
                                    <div class="cont_ul_li_md">
                                        <i></i><span>${item.orderdownaddress}</span>
                                    </div>
                                    <div class="dwk_ul_ms" style="display: ${item.memo==null||item.memo==""?"none":'block'}">
                                        <div class="dwk_ul_ms_yc"><span class="wk_ul_ms_ckgd" style="display: ${webkd(item.memo)?"block":"none"}">查看更多</span>描述:${item.memo}<span class="wk_ul_ms_sq" style="display:none;">收起</span></div>
                                    </div>

                                </div>
                                <div class="cont_bottom">
                                    <div class="cont_bottom_l">
                                        <span>车费：</span><div>￥<span>${(item.price).substr(0,(item.price).indexOf("."))}</span>${item.price.substr(item.price.indexOf("."))}</div>
                                    </div>
                                    <div class="cont_bottom_r" data-id="${item.orderid}">请他接我</div>
                                </div>
                            </div>
                        </li>`
                        });
                        myscroll.refresh();
                        console.log(contlist)
                        $(".cont ul").html(contlist)
                        // $(".pull_loading").hide();
                    }else if(data.code==101){
                        let dqurl=window.location.href;
                        window.location.href=`${appPara.mwurl}/app/webchatCall?url=${dqurl}`
                    }else{
                        GJ.msg(data.msg,2000);
                        GJ.loadHide()
                    }
                },
                timeout: 20000,
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    GJ.loadHide();
                    GJ.msg("网络太忙了，请稍后再试！",2000);
                }
            });
        }else{
            $(".pull_loading span").text("暂无更多数据");
            $(".pull_loading_img1").hide();
        }
    }
</script>
</html>